<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>主页-成都华联</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
        <script src="../../layui/layui.js" charset="utf-8"></script>
        <script>var $ = layui.jquery;</script>
    </head>
    <body>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend>用户信息</legend>
        </fieldset>
        <div style="text-align: center">
            <div id="name" style="margin-bottom: 10px;margin-top: 50px"></div>
            <div id="phone" style="margin-bottom: 200px"></div>
            <div id="regTime"></div>
        </div>
    </body>

    <script>
        if(!window.localStorage.getItem('wzphone')){
            window.location.href='/userLogin.html';
        }
        var phone = window.localStorage.getItem('wzphone');
        $.ajax({
            url: "/user"
            , type: "post"
            , headers: {"method": "myInf"}
            , data: {
                "phone": phone
            }
            , dataType: "json"
            , success: function (result) {
                if (result.code == 0) {
                    var date = result.data.regTime;
                    $("#name").html(result.data.name);
                    $("#phone").html(result.data.phone);
                    $("#regTime").html(
                        date.slice(0,4)+"年"+
                        date.slice(5,7)+"月"+
                        date.slice(8,10)+"日"+
                        date.slice(11,13)+"时"+
                        date.slice(14,16)+"分"+
                        date.slice(17,19)+"秒加入华联大家庭"
                    );
                }
            }
        })
    </script>
</html>